<%@ page language="java" contentType="text/html; charset=EUC-KR"
    pageEncoding="EUC-KR"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=EUC-KR">
<title>Insert title here</title>
</head>
<body>
<%@ page import = "java.sql.*, java.util.*" %>
<%

String jdbcUrl = "jdbc:mysql://localhost/theater?useUnicode=true&characterEncoding=EUC_KR";;
String dbUser = "root";
String dbPass = "apmsetup";


request.setCharacterEncoding("EUC-KR");

String id = (String)session.getAttribute("ID");
String password = request.getParameter("password");
String name = request.getParameter("name");
String birth = request.getParameter("birth");
String address = request.getParameter("address");
String phonenumber = request.getParameter("phonenum");

Connection con = null;
Statement stmt = null;
String sql;

try {
	Class.forName("com.mysql.jdbc.Driver");
	con = DriverManager.getConnection(jdbcUrl, dbUser, dbPass);
	sql = "update customer set Password = '"+password+"', C_Name = '"+name+"', Birth = '" +birth+"', C_Address = '" + address+"', C_Phonenum = '"+phonenumber+"' where CustomerID = '"+id+"'";
	stmt=con.createStatement();
	
	stmt.executeUpdate(sql);
	
	out.print("<script>");	
	out.print("location.href='member_info.jsp';");
	out.print("</script>");
	
} catch (SQLException e) {
	e.printStackTrace();
} finally {

	if(stmt != null)
		try {
			stmt.close();
		} catch (Exception e) {}
	if(con != null)
		try {
			con.close();
		} catch (Exception e) {}
}
%>


</body>
</html>